import request from '@/utils/request'

export function fetchList(query) {
  if(query != undefined){
    query = JSON.parse(JSON.stringify(query))
  }
  return request({
    url: '/user/getList',
    method: 'post',
    data:query
  })
}
export function fetchRoleList(query) {
  if(query != undefined){
    query = JSON.parse(JSON.stringify(query))
  }
  return request({
    url: '/user/role/getList',
    method: 'post',
    data:query
  })
}
export function saveUser(query) {
  if(query != undefined){
    query = JSON.parse(JSON.stringify(query))
  }
  return request({
    url: '/user/save',
    method: 'post',
    data:query
  })
}
export function removeUserByID(query) {
  if(query != undefined){
    query = JSON.parse(JSON.stringify(query))
  }
  return request({
    url: '/user/delete',
    method: 'post',
    data:query
  })
}

export function fetchArticle(id) {
  return request({
    url: '/user/getDetail',
    method: 'post',
    data: { id }
  })
}
